/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.is.city.routemanager;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.geotools.swing.control.DnDList;

/**
 *
 * @author oleg
 */
public class SaveRouteAction implements ActionListener {

    DnDList<Route> list;

    public SaveRouteAction(DnDList<Route> list) {
        this.list = list;
    }

    

    @Override
    public void actionPerformed(ActionEvent e) {
        int[] selectedIndices = list.getSelectedIndices();
        for (int i = 0; i < selectedIndices.length; i++) {
            Route elementAt = list.getModel().getElementAt(i);
            DefaultRouteFactory.exportToShapefile(elementAt);
        }
    }
}
